using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlInclude(typeof(LineString))]
    [XmlInclude(typeof(LinearRing))]
    [XmlInclude(typeof(Point))]
    [XmlInclude(typeof(Polygon))]
	public abstract class GeometryElementsGeometry : Geometry
	{
        private bool extrudeField, tessellateField;
        private AltitudeModeEnum altitudeModeEnum;

        public GeometryElementsGeometry()
		{
            this.extrudeField = false;
            this.tessellateField = false;
            this.altitudeModeEnum = AltitudeModeEnum.ClampToGround;
		}

        [XmlElement(ElementName = "extrude", DataType = "boolean")]
        [DefaultValue(false)]
        public bool Extrude
        {
            get { return this.extrudeField; }
            set { this.extrudeField = value; }
        }

        [XmlElement(ElementName = "tessellate", DataType = "boolean")]
        [DefaultValue(false)]
        public bool Tessellate
        {
            get { return this.tessellateField; }
            set { this.tessellateField = value; }
        }

        [XmlElement(ElementName = "altitudeMode", Type = typeof(AltitudeModeEnum))]
        [DefaultValue(AltitudeModeEnum.ClampToGround)]
        public AltitudeModeEnum AltitudeMode
        {
            get { return this.altitudeModeEnum; }
            set { this.altitudeModeEnum = value; }
        }
    }

    [XmlType(TypeName = "altitudeModeEnum")]
    public enum AltitudeModeEnum
    {
        [XmlEnum(Name = "clampToGround")]
        ClampToGround,

        [XmlEnum(Name = "relativeToGround")]
        RelativeToGround,

        [XmlEnum(Name = "absolute")]
        Absolute
    }
}